package model;

import java.util.ArrayList;
import java.util.Iterator;

public class Team {
	
	

	private String name;
	private ArrayList<Player> playerList;
	
	public Team(String name){
		setName(name);
	}
	
	public Team (String name, ArrayList<Player> players){
		setName(name);
		playerList = players;
	}
	
	public String getName(){
		return name;
	}
	
	public void setName(String str){
		name = str;
	}
	
	public ArrayList<Player> getList(){
		return playerList;
	}
	
	public void addPlayer(String name, String number){
		playerList.add(new Player(name, number));
	}
	
	public String toString(){
		
		Iterator<Player> itr = playerList.iterator();
		
		String string = name;
		while (itr.hasNext()){
			string = string +"/n";
			string = string+itr.toString();
		}
		return string;
	}
}
